package com.atguigu.mall.weball.controller;

import com.atguigu.gmall.feign.cart.CartFeignClient;
import com.atguigu.gmall.feign.order.OrderFeignClient;
import com.atguigu.gmall.feign.product.ProductSkuDataFeign;
import com.atguigu.gmall.order.vo.OrderconfirmRespVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class orderController {
    @Autowired
    private OrderFeignClient  client;
    @GetMapping("/trade.html")
    public String trade(Model model) {
        //TODO 1 需要远程调用商品服务   2 需要远程调用订单服务
        OrderconfirmRespVo respVo = client.orderConfirmData().getData();

        model.addAttribute("detailArrayList",respVo.getDetailArrayList());
        model.addAttribute("totalNum", respVo.getTotalNum());
        model.addAttribute("tradeNo", respVo.getTradeNo());
        model.addAttribute("userAddressList", respVo.getUserAddressList());
        model.addAttribute("totalAmount",respVo.getTotalAmount());
        return "order/trade";
    }
}
